package s.k.gui.webtest.unittest;

import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import s.k.gui.webtest.BrowserType;
import s.k.gui.webtest.basetools.SKBaseTools;
import s.k.gui.webtest.basetools.SKWindow;

public class SKTestPaoPage {

	@BeforeMethod
	public void setUp() {

		System.setProperty("webdriver.firefox.bin",
				"E:\\Program Files\\Mozilla Firefox\\firefox.exe");

		SKWindow.openNewWindow(BrowserType.WebDriverFirefox,
				"http://gpu.pcpop.com/");

		System.out.println("----------------测试开始---------------------");
	}

	@AfterMethod
	public void destory() throws InterruptedException {

		System.out.println("----------------测试结束---------------------");

		System.out.println("----------------准备关闭浏览器---------------");

		for (int i = 5; i >= 1; i--) {

			Thread.sleep(1000);

			System.out.println("还有 " + i + " 秒浏览器就要关闭了");

		}
		SKWindow.closeAllWindows();

		System.out.println("-----------------浏览器关闭成功！-------------");

	}

	@Test
	public void CheckText() {

		SKPaoPageTest sktest = new SKPaoPageTest();

		for (int i = 0; i < 10; i++) {

			sktest.checkStore();

			SKBaseTools.sleep(2);
		}
	}

}
